-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
20240628.0 #21223
20240628.0 #21223
Conversation
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
double primaryAction
Change icon header labels
Implement storage variables
Reload application credentials after delete
Implement search functions
WalkthroughWalkthroughThe update entails various dependency upgrades, user interface enhancements, and minor functionality adjustments within the Home Assistant project. Updates include version bumps for key dependencies, UI component replacements from Material Web Components to Home Assistant-specific components, and refined labels for consistency. Changes
Sequence Diagram(s)None. Recent review detailsConfiguration used: CodeRabbit UI Files ignored due to path filters (1)
Files selected for processing (11)
Additional context usedBiome
Additional comments not posted (14)
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
Outside diff range comments (10)
src/panels/lovelace/cards/hui-horizontal-stack-card.ts (1)
Line range hint
26-26
: Static analysis issue: Use ofsuper
in static context.Using
super
in a static method can lead to confusion. It's safer to reference the parent class directly by its name.- super.sharedStyles, + HuiStackCard.sharedStyles,src/panels/lovelace/cards/hui-card.ts (2)
Line range hint
103-103
: Avoid usingany
type.Using
any
disables TypeScript's type checking. Specify more precise types to enhance code safety and maintainability.Also applies to: 163-163, 171-171, 172-172
Line range hint
114-114
: Avoid non-null assertions.Non-null assertions can lead to runtime errors. Use optional chaining (
?.
) or other checks instead.- this._element!.hass = this.hass; + this._element?.hass = this.hass;Also applies to: 298-298
src/panels/config/users/dialog-add-user.ts (1)
Line range hint
272-272
: Avoid usingany
type.Using
any
disables TypeScript's type checking. Specify more precise types to enhance code safety and maintainability.Also applies to: 285-285
Tools
Biome
[error] 298-298: Forbidden non-null assertion.
Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator
(lint/style/noNonNullAssertion)
src/panels/config/script/ha-script-picker.ts (3)
Line range hint
220-220
: Replace non-null assertions with optional chaining.Non-null assertions have been used in various parts of the code, which can lead to runtime errors if not handled properly. Replacing these with optional chaining will make the code safer and more robust.
- this.hass! + this.hass?. // Apply this change to all relevant linesAlso applies to: 240-240, 857-857, 868-868, 881-881, 904-904, 1162-1163
Line range hint
844-844
: Reduce cognitive complexity in the function.The function
_handleBulkArea
has a cognitive complexity of 28, which is above the recommended threshold. Consider refactoring to simplify this function, possibly by breaking it down into smaller, more manageable functions.
Line range hint
957-957
: Specify more precise types instead of usingany
.The use of
any
type at various places reduces the benefits of TypeScript's static type checking. It is advisable to replaceany
with more specific types to improve code reliability and maintainability.- private _duplicate(script: any) { + private _duplicate(script: ScriptEntity) {Also applies to: 1067-1067, 1082-1082, 1086-1086, 1093-1093, 1120-1120, 1135-1135, 1153-1153, 1169-1169, 1177-1177
src/panels/config/automation/ha-automation-picker.ts (3)
Line range hint
230-230
: Replace non-null assertions with optional chaining.Using non-null assertions can lead to runtime errors if the object is null or undefined. It's safer to use optional chaining.
- this._overflowMenu!.open + this._overflowMenu?.open - this.hass!.localize("ui.common.delete") + this.hass?.localize("ui.common.delete") - this.hass!.localize("ui.common.cancel") + this.hass?.localize("ui.common.cancel") - this.hass!.localize("ui.panel.config.automation.picker.bulk_actions.enable") + this.hass?.localize("ui.panel.config.automation.picker.bulk_actions.enable") - this.hass!.localize("ui.panel.config.automation.picker.bulk_actions.disable") + this.hass?.localize("ui.panel.config.automation.picker.bulk_actions.disable") - this.hass!.localize("ui.panel.config.automation.picker.delete") + this.hass?.localize("ui.panel.config.automation.picker.delete") - this.hass!.localize("ui.panel.config.automation.picker.delete_confirm_title") + this.hass?.localize("ui.panel.config.automation.picker.delete_confirm_title") - this.hass!.localize("ui.panel.config.automation.picker.delete_confirm_text", { name: automation.name }) + this.hass?.localize("ui.panel.config.automation.picker.delete_confirm_text", { name: automation.name })Also applies to: 251-251, 964-964, 975-975, 989-989, 1012-1012, 1137-1137, 1138-1138
Line range hint
951-951
: Refactor to reduce complexity in_applyFilters
.The complexity of
_applyFilters
exceeds the recommended limit, which can make the function difficult to understand and maintain. Consider breaking it down into smaller, more focused functions.
Line range hint
1147-1147
: Avoid usingany
type for better type safety.Using
any
type disables TypeScript's type checking, which can lead to less predictable code. Specify explicit types where possible.Also applies to: 1171-1171
@@ -31,6 +31,8 @@ export class HuiCard extends ReactiveElement { | |||
|
|||
@property({ attribute: false }) public hass?: HomeAssistant; | |||
|
|||
private _elementConfig?: LovelaceCardConfig; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New properties and methods look good, but consider type safety improvements.
The introduction of _elementConfig
and methods like _updateElement
enhance modularity and maintainability. However, consider replacing any
types with more specific ones.
- catch (e: any) {
+ catch (e: Error) {
Also applies to: 86-93, 97-97, 147-154
{ | ||
type: "homeassistant", | ||
}, | ||
]; | ||
this._params!.userAddedCallback(user); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid non-null assertions.
Non-null assertions can lead to runtime errors. Use optional chaining (?.
) or other checks instead.
- this._params!.userAddedCallback(user);
+ this._params?.userAddedCallback(user);
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
this._params!.userAddedCallback(user); | |
this._params?.userAddedCallback(user); |
Tools
Biome
[error] 298-298: Forbidden non-null assertion.
Unsafe fix: Replace with optional chain operator ?. This operator includes runtime checks, so it is safer than the compile-only non-null assertion operator
(lint/style/noNonNullAssertion)
Summary by CodeRabbit
New Features
Bug Fixes
Dependency Updates
Refactor
Enhancements